<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>美兰数据文化馆与图书馆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/huazhi/css/public.css" media="all">
    <link rel="shortcut icon" href="<%=request.getContextPath()%>/huazhi/images/favicon.ico"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <blockquote class="layui-elem-quote">
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input class="layui-input searchval" type="text" placeholder="请输入搜索的内容">
                            </div>
                            <button class="layui-btn" id="search_btn" data-type="reload">搜索</button>
                        </div>
                    </blockquote>
                    <table class="layui-hide" id="applyTable" lay-filter="applyTables"></table>
                    <div id="laypage"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="curnum" value="1">
<script type="text/html" id="table-apply">

    {{#  if(d.type ==1){ }}

        {{# if(d.apply=='2'){}}

        {{# } else {}}

        {{# if(d.apply=='1'){}}
        <%--    <a class="layui-btn layui-btn-disabled layui-btn-xs">已入库</a>--%>
        {{# } else {}}
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="confirm">确认入库</a>
        {{# } }}

        {{# } }}


    {{#  } else { }}

    {{#  } }}

    <a class="layui-btn layui-btn layui-btn-xs" lay-event="info">清单详情</a>
    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="process"></i>审批过程</a>
<%--    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">撤销</a>--%>
</script>
<script type="text/html" id="titleTpl">
    {{#  if(d.type ==1){ }}
    采购申请
    {{#  } else { }}
    领用申请
    {{#  } }}
</script>
<script src="<%=request.getContextPath()%>/huazhi/lib/layui-v2.5.5/layui.all.js"></script>
<script src="<%=request.getContextPath()%>/huazhi/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['table', 'layer', 'form','apply'], function () {
        var $ = layui.jquery,
            table = layui.table,
            layer = layui.layer,
            form = layui.form;
        //搜索事件
        var active = {
            reload: function () {  //data-type='reload'
                var searchval = $('.searchval').val();
                $("#curnum").val("1");
                table.reload('applyTable', { //表格的id
                    where: {
                        key: searchval,
                        page: 1,
                        limit: 10,
                    },
                    text: {
                        none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
                    }
                })
            }
        };

        $('#search_btn').on('click', function () { //搜索的id
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
</body>
</html>
